﻿/*! @file extdevicedlg.h
  * @brief Defines class ExtDeviceDlg
  * @author AK
  * @date 08.08.2012
  */

#ifndef EXTDEVICEDLG_H
#define EXTDEVICEDLG_H

#include <QDialog>
class ExtDeviceDlg;

// forward declarations
class QComboBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpacerItem;
class QString;
class QTextEdit;

/**
 * @brief Definition of ExtDeviceDlg Class
 *
 * @class ExtDevice extdevice.h "PlacesParser/extdevicedlg.h"
 */
class ExtDeviceDlg : public QDialog
{
    Q_OBJECT

public:
    ExtDeviceDlg(QList<QString> deviceList, QWidget *parent = 0);

    QPushButton *closeButton;
    QString     expoDir;

    void        disableCloseButton();
    void        enableCloseButton();
    QString     getActiveDevice();
    void        setComboToolTip(QString status,
                                QString model,
                                QString rooted,
                                QString uid,
                                QString text);
    void        setLogTextViewText(QString output, QColor);

Q_SIGNALS:
    QString deviceChanged(QString);
    QString directoryChanged(QString);
    void    doExport(QString, QString);
    void    expoDone();
    QString gotDevice(QString);         // emits selected device
    void    logRequest(QString);
    void    propertiesRequest(QString);
    void    providerRequest(QString);
    void    reloadDevices(QString);     // for now it does uid stuff

private:
    // UI members
    QSpacerItem *buttonSpacer;
    QComboBox   *deviceComboBox;
    QLabel      *deviceLabel;
    QLabel      *deviceRooted;
    QLabel      *deviceRootedLabel;
    QLabel      *deviceStatus;
    QLabel      *deviceStatusLabel;
    QLabel      *deviceModelLabel;
    QLineEdit   *expoFolderEdit;
    QLabel      *expoFolderLabel;
    QPushButton *getLogButton;
    QPushButton *getPropsButton;
    QPushButton *getProviderDbsButton;
    QLabel      *logLabel;
    QTextEdit   *logTextEdit;
    QPushButton *okButton;
    QPushButton *openExpoDirButton;
    QSpacerItem *providerSpacer;
    QPushButton *reloadDevicesButton;
    QString     selectedDevice;
    QSpacerItem *statusSpacer;

private Q_SLOTS:
    void setDevice(QString);
    void on_closeButtonClicked();
    void on_expoFolderEditChanged();
    void on_getLogButtonClicked();
    void on_getPropsButtonClicked();
    void on_getProviderDbsButtonClicked();
    void on_okButtonClicked();
    void on_openExpoDirButtonClicked();
    void on_reloadDeviceButtonClicked();
};

#endif // EXTDEVICEDLG_H
